﻿<form class="spacing-bottom-sm row" page-header="Manage standards" ng-submit="reSearch()">
    <div class="col-sm-6">
        <input class="form-control" ng-model="filters.name" placeholder="Search procedure name" autofocus />
    </div>
    <div class="col-sm-6">
        <a class="btn btn-info" ui-sref="procedure-new" has-access="StandardCreate">
            <b class="glyphicon glyphicon-plus"></b> New Procedure
        </a>
    </div>
</form>

<table ng-table="tableParams" class="table table-hover table-bordered ng-table-resizable-columns" ng-visible="$data.length">
    <tr ng-repeat="item in $data">
        <td data-title="'#'" header-class="col-sm-1 width5"><span class="form-control-static">{{item.id}}</span></td>

        <td data-title="'PoName'" header-class="col-sm-1"><span class="form-control-static" style="white-space:nowrap;">{{item.procedureName}}</span></td>
        <td data-title="'Standard 1'" header-class="col-sm-1 width7"><span class="form-control-static">{{item.items[0].standardNo}}</span></td>
        <td data-title="'Standard 2'" header-class="col-sm-1 width7"><span class="form-control-static">{{item.items[1].standardNo}}</span></td> 
        <td data-title="'Standard 3'" header-class="col-sm-1 width7"><span class="form-control-static">{{item.items[2].standardNo}}</span></td> 
        <td data-title="'Standard 4'" header-class="col-sm-1 width7"><span class="form-control-static">{{item.items[3].standardNo}}</span></td> 
        <td data-title="'Standard 5'" header-class="col-sm-1 width7"><span class="form-control-static">{{item.items[4].standardNo}}</span></td>
        <td data-title="'Temperature'" header-class="col-sm-1 width7"><span class="form-control-static">{{item.temperature}}</span></td>
        <td data-title="'Relative Humidity'" header-class="col-sm-1 width7"><span class="form-control-static">{{item.humidity}}</span></td>
        <td data-title="'Note'" header-class="col-sm-1 width7"><span class="form-control-static">{{item.note}}</span></td>      
        <td data-title="'Approved By'" header-class="col-sm-1 width10"><span class="form-control-static">{{item.approveUser.fullName}}</span></td>
        <td class="text-center" header-class="col-sm-1 width5">
            <a ui-sref="procedure-item({id: item.id})" class="btn btn-default">View</a>
        </td>
    </tr>
</table>
<div ng-show="!tableParams.settings().$loading && tableParams.data.length === 0" class="well text-center">No result</div>
